package example.strategy.irreversible;

import org.apache.log4j.Logger;
import com.scop.desensitize.encry.irreversible.AbstractIRreversibleEncry;
import com.scop.desensitize.exception.factory.FactoryException;
import com.scop.desensitize.exception.strategy.EncodeException;
import com.scop.desensitize.factory.encry.EStrategy;
import com.scop.desensitize.factory.encry.irreversible.IrreverSibleFactory;

import java.security.NoSuchAlgorithmException;

/**
 * @desc：
 * @author： QGP
 * @create： 2022/4/28 11:09
 */
public class IdCardDemo {
    public static Logger log = Logger.getLogger(IdCardDemo.class);
    public static void main(String[] args) throws EncodeException, NoSuchAlgorithmException, FactoryException {

        AbstractIRreversibleEncry encry = IrreverSibleFactory.create(EStrategy.IDCARD);
        //加密
        String encryption =(String) encry.encode("hello world");
        log.info("加密后："+encryption);

    }
}
